package com.securityLearn.securityAuth.config.exceptionHandler;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 全局异常处理
 * @author duzq
 * @date 2021-8-26 21:10:37
 */
@ControllerAdvice
public class SecurityAuthExceptionHandler {

    @ResponseBody
    @ExceptionHandler(value = RuntimeException.class)
    public String RuntimeExceptionHandler(RuntimeException e) {
        return "全局异常捕获： " + e.getMessage();
    }
}
